package com.almm.s_utils.Util;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;


import java.util.Map;


@Component
public class ComUtil {
    private static int count = 0;

    public static synchronized String generateSequence() {
        count++;
        return String.format("%06d", count);
    }


    public static JSONObject generateJSON(Map<String, Object> map){
        if(map == null || map.isEmpty()){
            return null;
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.putAll(map);
        return jsonObject;
    }

}
